﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Simple.Tools.Entity
/// <summary>
/// 版 本 钢易智企2.0 V 2.0.0 钢易智企2.0
/// Copyright (c) 2023 杭州钢易科技有限公司
/// 创建人：曾东明
/// 日 期：2024
/// 描 述：
/// </summary>
{
    /// <summary>
    /// 键值对还包含扩展字段
    /// </summary>
    /// <typeparam name="TKey"></typeparam>
    /// <typeparam name="TValue"></typeparam>
    public class KeyValue<TKey, TValue> : IKeyValue<TKey, TValue>
    {
        /// <summary>
        /// key
        /// </summary>
        public TKey Key { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public TValue Value { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get;set; }
        /// <summary>
        /// 扩展字段1
        /// </summary>
        public string Extend1 { get; set; }
        /// <summary>
        /// 扩展字段2
        /// </summary>
        public string Extend2 { get; set; }

		/// <summary>
		/// 扩展字段3
		/// </summary>
		public string Extend3 { get; set; }
		/// <summary>
		/// 扩展字段4
		/// </summary>
		public string Extend4 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(IKeyValue<TKey, TValue> other)
        {
            if (SimpleCheck.IsNull(other))
            {
                return false;
            }
            if (other==this || other.Equals(this))
            {
                return true;
            }
            return false;
        }
    }
}